<?php
header("Content-Type: text/html; charset=ISO-8859-1",true);
if(!isset($_SESSION))session_start();
if(!isset($_SESSION['usuario'])){
	session_destroy();
	header("location:index.php"); exit;
	}

       /* include_once 'classes/crud.php';
        $con = new Crud();
        $con->connect();
*/
  extract($_POST);
$id_fun = $_SESSION['id_funcionario'];
$pas = $_POST['past'];
$addarquivo = $_POST['arquivo'];
$setor=$_POST['setor'];
include 'classes/classeupload.php';
$arquivo = $_FILES['arquivo'];
$referencia = $_POST['referencia'];
$descricao = $_POST['descricao'];
$up = new classeUpload($numero, $tipo);


$sql = ("select ca.nome from categorias cat INNER JOIN categorias ca on ca.heranca = cat.id 
where cat.nome='$setor' and ca.heranca=cat.id and ca.nome='$pas'");


if($_POST[seguimento] == 'seguimento1' )
$up->comSegui($arquivo, $past, $referencia, $descricao, $id_fun, $setor, $addarquivo);
elseif ($_POST[seguimento] == 'seguimento2')
$up->semSegui($arquivo, $pas, $referencia, $descricao, $id_fun, $setor);





/*foreach ($_FILES as $arquivo => $valores) {
    if ( empty( $valores["name"] ) ) {
        unset( $_FILES[$arquivo] );
    } else {
        if( preg_match( "/^image\/(jpeg|png|gif|bmp)$/", $valores["type"] ) ) {
            $novo_path = "fotos".DIRECTORY_SEPARATOR.strtolower( $valores["name"] );
            move_uploaded_file( $valores["tmp_name"], $novo_path );
            echo 'aki';
        }
    }
}

 */



?>